package lesson5;

public class MyClass {
//    private static MyClass instance = new MyClass();
//    public static MyClass getInstance(){
//        return instance;
//    }

    private static MyClass instance;
    public static MyClass getInstance(){
        if(instance == null){
            instance = new MyClass();
        }
        return instance;
    }

    public static void clearInstance(){
        instance = null;
    }
}
